<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="renderer" content="webkit">
<title>大连交通大学在线服务平台</title>
<link href="../css/bootstrap.min.css" rel="stylesheet" />
<link href="../css/font-awesome.min.css" rel="stylesheet" />
<link href="../css/common.css" rel="stylesheet" />
<link href="../images/favicon.ico" rel="shortcut icon" />
<script src="../js/jquery.min.js"></script>
<script src="../js/bootstrap.js"></script>
<script src="../js/bootstrapValidator.min.js"></script>
<script src="../js/language/zh_CN.js"></script>
<script src="../js/common.js"></script>
<script type="text/javascript">
	$(document).ready(function() {
		$('#goodsUpdateForm').bootstrapValidator();
	});
</script>
</head>
<body>
	<div class="center-block-2">
		<div class="list-group">
			<p class="list-group-item active">
				<img src="../images/ershou.png" width="20px" height="20px" alt="" /> 修改二手物品：
			</p>
			<div class="row" style="position: relative; left: 100px; width: 500px;">
				<form id="goodsUpdateForm" action="goods_i_update.do?gid=${update_goods.gid}&uid=${user.uid}"
					method="post" class="form-horizontal" data-bv-message="此项为必填项"
					data-bv-feedbackicons-valid="glyphicon glyphicon-ok"
					data-bv-feedbackicons-invalid="glyphicon glyphicon-remove"
					data-bv-feedbackicons-validating="glyphicon glyphicon-refresh" enctype="multipart/form-data">
					<div class="form-group">
						<label class="col-md-2 control-label">商品名称:</label>
						<div class="col-md-10">
							<input type="text" value="${update_goods.name}" name="goods.name" class="form-control"
								data-bv-notempty="true" />
						</div>
					</div>
					<div class="form-group">
						<label class="col-md-2 control-label">价格:</label>
						<div class="col-md-10">
							<input type="text" value="${update_goods.price}" name="goods.price" class="form-control"
								placeholder="10.00" data-bv-notempty="true" data-bv-regexp="true"
								data-bv-regexp-regexp="^[1-9]{1}[0-9]{0,10}[.]{0,1}[0-9]{0,2}$" data-bv-regexp-message="请填写正确的数字" />
						</div>
					</div>
					<div class="form-group">
						<label class="col-md-2 control-label">商品类型:</label>
						<div class="col-md-10">
							<select class="form-control" name="goods.type">
								<c:forEach items="${application.good_type}" var="good_type" begin="0" end="9">
									<option value="${good_type.optcode}">${good_type.optname}</option>
								</c:forEach>
							</select>
						</div>
					</div>
					<div class="form-group">
						<label class="col-md-2">新旧程度:</label>
						<div class="col-md-10">
							<select class="form-control" name="goods.level">
								<c:forEach items="${application.good_level}" var="good_level" begin="0" end="9">
									<option value="${good_level.optcode}">${good_level.optname}</option>
								</c:forEach>
							</select>
						</div>
					</div>
					<div class="form-group">
						<label class="col-md-2 control-label">商品所在地:</label>
						<div class="col-md-10">
							<select class="form-control" name="goods.location">
								<c:forEach items="${application.location}" var="location" begin="0" end="9">
									<option value="${location.optcode}">${location.optname}</option>
								</c:forEach>
							</select>
						</div>
					</div>
					<div class="form-group">
						<label class="col-md-2 control-label">介绍图片:</label>
						<div class="col-md-10">
							<input name="image" type="file" class="form-control" />
						</div>
					</div>
					<div class="form-group">
						<label class="col-md-2 control-label">详细介绍:</label>
						<div class="col-md-10">
							<textarea placeholder="${update_goods.name}" class="form-control" name="goods.detail" rows="5"></textarea>
						</div>
					</div>
					<div class="form-group">
						<div class="col-md-10 col-md-offset-2">
							<a href="er-list.jsp" class="btn btn-sm btn-info glyphicon glyphicon-menu-left">&nbsp;返回</a>
							<button type="submit" class="btn btn-sm btn-success glyphicon glyphicon-ok">&nbsp;修改!</button>${user_goods_update_msg}
						</div>
					</div>
				</form>
			</div>
		</div>
	</div>
</body>
</html>